﻿using System.ComponentModel.Composition;
using WafApplication1.Applications.Services;
using WafApplication1.Applications.ViewModels;

namespace WafApplication1.Applications.Controllers
{
    [Export]
    internal class ApplicationController
    {
        private readonly ShellService shellService;
        private readonly ShellViewModel shellViewModel;
        private readonly HouseTypeController houseTypeController;
        private readonly PageViewController pageViewController;

        [ImportingConstructor]
        public ApplicationController(ShellViewModel shellViewModel, ShellService shellService, HouseTypeController houseTypeController, PageViewController pageViewController)
        {
            this.shellViewModel = shellViewModel;
            this.shellService = shellService;
            this.houseTypeController = houseTypeController;
            this.pageViewController = pageViewController;
        }

        public void Initialize()
        {
            shellService.ShellView = shellViewModel.View;
            houseTypeController.Initialize();
            pageViewController.Initialize();
        }

        public void Run()
        {
            shellViewModel.Show();
        }

        public void Shutdown()
        {
        }
    }
}
